How Pressure-Volume Loops Are Generated